import { createApp } from 'vue'
import App from '@/App.vue'
import * as Lodash from 'lodash-es'
import vuex from '@/stores/vuex'
import router from '@/router'
import i18n from '@/locales'
import 'ant-design-vue/dist/reset.css'
import 'virtual:uno.css'

const app = createApp(App)
app.use(Pinia)
app.use(vuex)
app.use(router)
app.use(i18n)
app.config.globalProperties.$_ = Lodash

// 在应用挂载后同步语言设置
app.mount('#app').$nextTick(() => {
	const languageStore = useLanguageStore()
	// 同步 i18n 语言设置
	i18n.global.locale.value = languageStore.currentLanguage
})
